import os
import sys
import time


from main_util import start_access_control
from python_part.PolicyStoreModule import PolicyStoreModule

from GlobaLogger import Log
log = Log(__name__).getlog()

if __name__ == '__main__':
    # 0. 全局变量与配置
    # 1. 创建保存策略的类
    policy_save_path = sys.argv[1]
    tmp_path = sys.argv[2]
    policy_store_module = PolicyStoreModule(policy_save_path, tmp_path)
    # 2. 载入策略
    policy_store_module.load_database_from_file(policy_save_path)
    # 3. 启动
    start_access_control(policy_store_module)
